/**
 * Copyright (C), 2002-2017, 上海巧房信息技术有限公司
 * FileName: CollectRuleServiceConvert
 * @Author:     yi.li
 * Date:     2018/6/29 17:18
 * Description: 采集规则服务转换器
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.qiaofang.collectmanage.dao.util;

import com.qiaofang.collectmanage.dao.domain.CollectRule;
import com.qiaofang.collectmanage.stub.bean.*;

public class CollectRuleDaoConvert {

    private CollectRuleDaoConvert(){}

    public static com.qiaofang.collectmanage.domain.CollectRule convertCollectRuleToResolveCollect(CollectRule collectRule) {
        if (collectRule == null) {
            return null;
        }
        com.qiaofang.collectmanage.domain.CollectRule resolveCollectRule = new com.qiaofang.collectmanage.domain.CollectRule();
        resolveCollectRule.setCity(collectRule.getCity());
        resolveCollectRule.setSource(collectRule.getSource());
        resolveCollectRule.setBelonger(collectRule.getBelonger());
        resolveCollectRule.setCollectHouseType(collectRule.getCollectHouseType());
        resolveCollectRule.setCollectType(collectRule.getCollectType());
        resolveCollectRule.setWebsite(collectRule.getWebsite());
        resolveCollectRule.setListWebCode(collectRule.getListWebCode());
        resolveCollectRule.setDetailWebCode(collectRule.getDetailWebCode());
        resolveCollectRule.setDefaultPages(collectRule.getDefaultPages());
        resolveCollectRule.setTopicName(collectRule.getTopicName());
        resolveCollectRule.setCreatedUserId(collectRule.getCreatedUserId());
        resolveCollectRule.setUpdatedUserId(collectRule.getUpdatedUserId());
        return resolveCollectRule;
    }

    public static CrawlerCollectRuleDTO convertCollectRuleToCrawlerCollectRule(CollectRule collectRule) {
        if (collectRule == null) {
            return null;
        }
        CrawlerCollectRuleDTO resolveCollectRule = new CrawlerCollectRuleDTO();
        resolveCollectRule.setId(collectRule.getId());
        resolveCollectRule.setUuid(collectRule.getUuid());
        resolveCollectRule.setCity(collectRule.getCity());
        resolveCollectRule.setSource(collectRule.getSource());
        resolveCollectRule.setBelonger(collectRule.getBelonger());
        resolveCollectRule.setCollectHouseType(collectRule.getCollectHouseType());
        resolveCollectRule.setCollectType(collectRule.getCollectType());
        resolveCollectRule.setWebsite(collectRule.getWebsite());
        resolveCollectRule.setListWebCode(collectRule.getListWebCode());
        resolveCollectRule.setDetailWebCode(collectRule.getDetailWebCode());
        resolveCollectRule.setDefaultPages(collectRule.getDefaultPages());
        resolveCollectRule.setTopicName(collectRule.getTopicName());
        resolveCollectRule.setCreatedUserId(collectRule.getCreatedUserId());
        resolveCollectRule.setUpdatedUserId(collectRule.getUpdatedUserId());
        resolveCollectRule.setCreatedTime(collectRule.getCreatedTime());
        resolveCollectRule.setUpdatedTime(collectRule.getUpdatedTime());
        return resolveCollectRule;
    }


}
